package org.rocky.core.exception;

import org.rocky.lang.Error;

/**
 * @author sunxinhe
 */
public class BusinessException extends RuntimeException {

    private String code;

    private String message;

    public BusinessException(Error error) {
        this.code = error.getCode();
        this.message = error.getMessage();
    }

    public BusinessException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public BusinessException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}
